/*
 * FlatPanel.java
 *
 * 
 */

package it.luigiarpino.alt2jsim.netpanel;
import it.luigiarpino.alt2jsim.core.Grafo;
import it.luigiarpino.alt2jsim.netpanel.flat.NetPanel;
import it.luigiarpino.alt2jsim.netpanel.flat.TextPanel;
import it.luigiarpino.alt2jsim.netpanel.flat.ZoomPanel;
import it.luigiarpino.alt2jsim.network.FlatNet;
import javax.swing.*;
import java.awt.*;


/**
 *
 * @author  Luigi Lorenzo Arpino 534/559
 */
public class FlatPanel extends JPanel {
    
    /**
	 * 
	 */
	private static final long serialVersionUID = 4446423719495586201L;
	private JTabbedPane jTabbedPane;
    
    /** Creates a new instance of FlatPanel */
    public FlatPanel(Grafo grafo_) {
        super();
        try { 
            javax.swing.UIManager.setLookAndFeel(javax.swing.UIManager.getSystemLookAndFeelClassName());     
    	} 
    	catch(Exception e) { }
        FlatNet net_=(FlatNet)grafo_.getNet();
        // riempio il jTabbedPane
        this.jTabbedPane=new JTabbedPane();
        this.jTabbedPane.addTab("Flat network",new NetPanel(net_.getFlatMatrix(),"Network",null,NetPanel.ROUTER));
        this.jTabbedPane.addTab("Zoom view",new ZoomPanel(net_));
        JLabel label=new JLabel(net_.getInfo());
        label.setFont(new Font(null,Font.PLAIN,20));
        JPanel pannello=new JPanel(new BorderLayout());
        pannello.add(label,BorderLayout.CENTER);
        this.jTabbedPane.addTab("Network information",pannello);
        this.jTabbedPane.addTab("Show translation",new TextPanel(grafo_));
        this.setLayout(new BorderLayout());
        this.add(this.jTabbedPane, BorderLayout.CENTER);
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {
        // TODO code application logic here
    }
    
}
